package com.varton;

import com.varton.strategy.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * @author lihuazeng
 */
public class App {
    public static void main(String[] args) {
        /**
         * 场景：执行决策策略，有多种策略，通过获取策略文件名进行选择运行
         */
        List<IAlias> aliasList = new ArrayList<>();
        aliasList.add(new AliasA());
        aliasList.add(new AliasB());
        aliasList.add(new AliasC());
        AliasContext aliasContext = new AliasContext(aliasList);


        Map<String, Object> reqMap = new HashMap<>();
        reqMap.put("age", 20);
        String name = aliasContext.getAlias(reqMap);
        System.out.println(name);
    }
}